#ifndef UPDATEPLAYERNETWORKEVENT_H_
#define UPDATEPLAYERNETWORKEVENT_H_

#include "NetworkEvent.h"
#include "Color.h"
#include <string>


class UpdatePlayerNetworkEvent : public NetworkEvent
{
public:
    enum Action
    {
        ADD,
        RESET
    };

    struct Data
    {
        Action action;
        char playerName[20];
        int playerId;
        Color playerColor;
    };

    struct Message
    {
        Header header;
        Data data;
    };

    UpdatePlayerNetworkEvent(Action action, int playerId, const char* playerName, const Color& color);
    UpdatePlayerNetworkEvent(const Header& header, const Data& data);
    virtual ~UpdatePlayerNetworkEvent();

    void* getMessageBlob();
    size_t getMessageBlobSize();

    virtual GameState* visitClientMenuState(ClientMenuState* clientMenuState) const;

private:
    Message message;
};

#endif
